package com.jmp.base;

import com.jmp.base.dto.*;
import one.stand.entity.TokenEntity;
import one.stand.model.ResultModel;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 安全接口API
 */
public interface SecurityUserApi {

    /**
     * 权限用户类型：0名片ID
     */
    int AUTH_USER_TYPE_CARD = 0;

    enum TypeAuth {
        DYNAMIC(0, "红木圈");

        private int code;
        private String name;

        TypeAuth(int code, String name) {
            this.code = code;
            this.name = name;
        }

        public int getCode() {
            return code;
        }

        public String getName() {
            return name;
        }
    }

    /**
     * 登陆信息验证
     */
    @PostMapping("security/login/info")
    ResultModel<TokenEntity> loginInfo(@RequestBody String token);

    /**
     * 用户：绑定微信
     */
    @PostMapping("security/user/bind/wx")
    ResultModel userBindWx(@RequestBody SecurityUserBindWxRequest request);

    @PostMapping("security/user/bind/wx2")
    ResultModel userBindWx2(@RequestBody SecurityUserBindWx2Request request);

    /**
     * 用户：绑定手机号
     */
    @PostMapping("security/user/bind/phone")
    ResultModel userBindPhone(@RequestBody SecurityUserBindPhoneRequest request);

    /**
     * 用户：绑定微信手机号
     */
    @PostMapping("security/user/bind/wx/phone")
    ResultModel<SecurityUserBindWxPhoneResponse> userBindWxPhone(@RequestBody SecurityUserBindWxPhoneRequest request);

    /**
     * 权限：保存
     */
    @PostMapping("security/auth/save")
    ResultModel<SecurityAuthSaveVo> authSave(@RequestBody SecurityAuthSaveDto request);

    /**
     * 权限：列表
     */
    @PostMapping("security/auth/list")
    ResultModel<SecurityAuthListVo> authList(@RequestBody SecurityAuthListDto request);

    /**
     * 权限：判断
     */
    @PostMapping("security/auth/check")
    ResultModel<SecurityAuthCheckVo> authCheck(@RequestBody SecurityAuthCheckDto request);
}
